package com.bw.controller;

import com.bw.bean.Vo;
import com.bw.service.VoService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class VoController {
    @Autowired
    VoService voService;

    @RequestMapping("/volist9")
    public Map volist9(){
        Double v = voService.volist9();
        Map flipNumberData = SugarUtil.getFlipNumberData(v);
        return flipNumberData;
    }

    @RequestMapping("/volist10")
    public Map volist10(){
        List<Vo> vos = voService.volist10();
        Map pieData = SugarUtil.getPieData(vos);
        return pieData;
    }

    @RequestMapping("/volist11")
    public Map volist11(){
        List<Vo> vos = voService.volist11();
        Map mapData = SugarUtil.getMapData(vos);
        return mapData;
    }

    @RequestMapping("/volist12")
    public List<Vo> volist12(){
        return voService.volist12();
    }

    @RequestMapping("/volist13")
    public List<Vo> volist13(){
        return voService.volist13();
    }

    @RequestMapping("/volist14")
    public List<Vo> volist14(){
        return voService.volist14();
    }

    @RequestMapping("/volist15")
    public List<Vo> volist15(){
        return voService.volist15();
    }
}
